home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / UCRASM25.ARJ / RMVITEM.ASM < prev    next >
Assembly Source File  |  1991-10-12  |  701b  |  47 lines

  1. StdGrp        group    stdlib,stddata
  2. stddata        segment    para public 'sldata'
  3. stddata        ends
  4. ;
  5. stdlib        segment    para public 'slcode'
  6.         assume    cs:stdgrp
  7. ;
  8. ;
  9. ; RmvItem-    Locates and removes the first (next) character in the set.
  10. ;
  11. ; inputs:
  12. ;
  13. ;    ES:DI-  Points at the set to search through.
  14. ;
  15. ; outputs:
  16. ;
  17. ;    AL-    Next available character in set (zero if set is empty).
  18. ;
  19. ;
  20.         public    sl_RmvItem
  21. ;
  22. sl_RmvItem    proc    far
  23.         push    cx
  24.         push    di
  25. ;
  26.         mov    al, es:[di]
  27.         mov    cx, 256
  28.         add    di, 7
  29. NextLp:        inc    di
  30.         test    al, es:[di]
  31.         loopz    NextLp
  32.         jz    NoMask
  33.         not    al
  34.         and    es:[di], al
  35.         inc    cx
  36. ;
  37. NoMask:        neg    cx
  38.         mov    al, cl
  39.         pop    di
  40.         pop    cx
  41.         ret
  42. sl_RmvItem    endp
  43. ;
  44. ;
  45. stdlib        ends
  46.         end
  47.